import React,{Component} from 'react';
import { Form, Row, Col, Input, Button, Table, Select} from 'antd';

const Option = Select.Option;
const FormItem = Form.Item;

class RecordByPro extends Component{
    constructor(props){
        super(props);
        this.state = {
            columns:[
                {
                    title: '流水号',
                    dataIndex: 'serialNumber',
                    key: 'serialNumber'
                },
                {
                    title: '出入库',
                    dataIndex: 'opeType',
                    key: 'opeType'
                },
                {
                    title: '日期',
                    dataIndex: 'createTime',
                    key: 'createTime'
                },
                {
                    title: '操作',
                    dataIndex: 'operate',
                    key: 'operate',
                    render:(text, record) => (
                        <span>
                            <a onClick={()=>this.showDetail(record)}>查看详情</a>
                        </span>
                    )
                },
            ],
            data:[]
        }
    }
    render() {
        return(
            <div>
                <Form layout="inline" onSubmit={this.getByDate} style={{ margin: '20px' }}>
                    <Row>
                        <Col span={6}>
                            <FormItem label="商品名称">
                                <Input placeholder="请输入商品名称"/>
                            </FormItem>
                        </Col>
                        <Col span={6}>
                            <FormItem label="商品编号">
                                <Input placeholder="商品编号"/>
                            </FormItem>
                        </Col>
                        <Col span={6}>
                            <FormItem label="出入库">
                                <Select allowClear="true" style={{ width: 120 }}>
                                    <Option value="1">入库</Option>
                                    <Option value="2">出库</Option>
                                </Select>
                            </FormItem>
                        </Col>
                        <Col span={6}>
                            <Button type="primary">查询</Button>
                        </Col>
                    </Row>
                </Form>
                <Row>
                    <Table rowKey={record => record.id} columns={this.state.columns} dataSource={this.state.data} ></Table>
                </Row>

            </div>
        );
    }
}
export default RecordByPro;